package com.itheima.thread.volatile_.demo02;

public class VolatileThreadDemo01 {

    public static void main(String[] args) {

        VolatileThread volatileThread = new VolatileThread();
        volatileThread.start();

        while (true){

            synchronized (volatileThread) {
                if (volatileThread.isFlag()) {
                    System.out.println("执行了======");
                }
            }

        }

    }
}
